# Contributor: Dmitry Zakharchenko <dmitz@disroot.org>
# Maintainer: Dmitry Zakharchenko <dmitz@disroot.org>
pkgname=pdfcpu
pkgver=0.6.0
pkgrel=0
pkgdesc="PDF processor written in Go"
url="https://pdfcpu.io"
arch="all"
license="Apache-2.0"
makedepends="go"
options="!check" # test suite fails
source="$pkgname-$pkgver.tar.gz::https://github.com/pdfcpu/pdfcpu/archive/v$pkgver.tar.gz"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -o bin/pdfcpu ./cmd/...
}

check() {
	go test ./...
}

package() {
	install -Dm755 bin/pdfcpu "$pkgdir"/usr/bin/pdfcpu
}

sha512sums="
8f4df561acc143bbfb3d4f96c11ed729d6f36ed22760cd2da1be6d211c0fdcab0a37be03afaa480c194079523e5359fa30d37354f0ac8004267f5521f9f5db72  pdfcpu-0.6.0.tar.gz
"
